<template>
  <div class="operatio-video">
    <titleBar titleText="系统操作视频" :hasBottomBorder="true">
      <span class="el-icon-more" @click="findVideoMore"></span>
    </titleBar>
    <div class="video-container">
      <video :src="newVideoObj.videoUrl || ''" controls="controls"></video>
      <span>最新视频： {{ newVideoObj.videoName || '--' }}</span>
    </div>
  </div>
</template>

<script>
import titleBar from '@/moduleComponents/newWorkbench/titleBar'
import {workbenchTrainVideoGetNew} from '@const/mDataCenterApi.js'
export default {
  name: 'OperatioVideo',
  components: {
    titleBar
  },
  data() {
    return {
      newVideoObj: {}
    }
  },
  created() {
    this.getNewVideo()
  },
  methods: {
    getNewVideo() {
      this.$axios({
        url: workbenchTrainVideoGetNew,
        method: 'post'
      })
        .then(res => {
          this.newVideoObj = res.data.payload || {}
          console.log(res, 'er')
        })
        .catch(err => {
          console.log(err)
        })
    },
    findVideoMore() {
      this.$router.push({
        path: '/newWorkbench/videoList'
      })
    }
  }
}
</script>

<style scoped lang="less">
.operatio-video {
  .video-container {
    padding: 8px 0;
    video {
      width: 100%;
      height: 75%;
    }
  }
  .el-icon-more {
    font-size: 20px;
    cursor: pointer;
    height: 100%;
  }
}
</style>
